import request from '@/util/request'
import { activityInit } from '@/type/activity'
// 查询全部活动
export const getActivity = (pageCurrent:number, pageSize:number) => {
  return request({
    url: `/activitys/${pageCurrent}/${pageSize}`
  })
}

//  根据id进行查询
export const QuerryActivity = (id:string) => {
  return request({
    url: `/activitys/${id}`
  })
}

// 新增活动
export const saveActivity = (activity:any) => {
  return request({
    url: '/activitys',
    data: activity,
    method: 'post'
  })
}

// 删除活动
export const deleteActivity = (id:number) => {
  return request({
    url: `activitys/${id}`,
    method: 'delete'
  })
}

// 更新活动
export const updateActivity = (activity:any) => {
  return request({
    url: '/activitys',
    method: 'put',
    data: activity
  })
}

// 获取活动预约成功的数据
export const getOrderSuccess = (statu:number, pageCurrent:number, pageSize:number) => {
  return request({
    url: `reservation/page/${statu}/${pageCurrent}/${pageSize}`
  })
}

// 获取活动预约失败的数据
export const getOrderDefeat = (statu:number, pageCurrent:number, pageSize:number) => {
  return request({
    url: `reservation/page/${statu}/${pageCurrent}/${pageSize}`
  })
}

// 获取预约审核的数据
export const getOrderCheck = (statu:number, pageCurrent:number, pageSize:number) => {
  return request({
    url: `reservation/page/${statu}/${pageCurrent}/${pageSize}`
  })
}

// 是否同意预约活动
export const updateStatu = (row:any) => {
  return request({
    url: 'reservation',
    method: 'put',
    data: row
  })
}
